home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10123 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: inforamp.net!ts26-11
  2. From: rmorin@inforamp.net (Randy Charles Morin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Class Pointer Array (HELP)
  5. Date: Wed, 06 Mar 96 06:27:28 GMT
  6. Organization: MiddleWorld SoftWare
  7. Message-ID: <4hjb88$elu@sam.inforamp.net>
  8. References: <4hfs8d$a0@nnrp1.news.primenet.com>
  9. NNTP-Posting-Host: ts26-11.tor.inforamp.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #4
  11.  
  12. In article <4hfs8d$a0@nnrp1.news.primenet.com>,
  13.    Brad Grossman <bjg@primenet.com> wrote:
  14. >.....I'm trying to make a program to do the dos DIR function for starters, 
  15. >then use the info for a few things.  I made up a class FileData to hold 
  16. >the file info.  The prog should work by reading each file, and putting 
  17. >the information into a pointer array of FileData that sorts the 
  18. >information as it is entered.  Only thing is, I am using the new operator 
  19. >to create new instances to be pointed to and sorted into the array is not 
  20. >working.  I got this same routine to work with integers, but can't get it 
  21. >wo work with the class.  Help!!!
  22.  
  23. Hmmm!  I couple suggestions...
  24.  
  25. #1    Use the predefined container (aka collection) classes provided with 
  26. Borland, Microsoft and other compilers.  For Borland you might want to use 
  27. TSArrayAsVector and for Microsoft the alternative would be CObList or 
  28. CObArray.  I know the TSArrayAsVector automatically sorts according to the <= 
  29. operator, but I don't know off hand how to sort using MFC collections (i.e. 
  30. never done it in MFC).
  31.  
  32. #2    If you don't have a predefined container class, then look at the 
  33. design of the Borland and Microsoft container classes and mimic them in your 
  34. environment.  
  35.  
  36. Agrivar
  37.